package com.magenta.maxoptra.geocoding.geoinformsputnik;

import javax.xml.bind.annotation.*;
import java.io.Serializable;

/**
 * User: Zlygostev
 * Date: 23.04.12
 * Time: 13:04
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Project")
public class Project implements Serializable {
    @XmlAttribute(name = "projectId")
    private int projectId;

    @XmlElement(name = "name")
    private String name;

    @XmlElement(name = "url")
    private String url;

    @XmlElement(name = "wmsUrl")
    private String wmsUrl;

    @XmlElement(name = "wfsUrl")
    private String wfsUrl;

    @XmlElement(name = "settingsUrl")
    private String settingsUrl;

    @XmlElement(name = "defaultX")
    private Float defaultX;

    @XmlElement(name = "defaultY")
    private Float defaultY;

    @XmlElement(name = "defaultScaleIndex")
    private Integer defaultScaleIndex;

    @XmlElement(name = "showOnMainPage")
    private Boolean showOnMainPage;

    @XmlElement(name = "defaultLayersSet")
    private String defaultLayersSet;

    @XmlElement(name = "transform")
    private String transform;

    @XmlTransient
    private Settings settings;

    public int getProjectId() {
        return projectId;
    }

    public void setProjectId(int projectId) {
        this.projectId = projectId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getWmsUrl() {
        return wmsUrl;
    }

    public void setWmsUrl(String wmsUrl) {
        this.wmsUrl = wmsUrl;
    }

    public String getWfsUrl() {
        return wfsUrl;
    }

    public void setWfsUrl(String wfsUrl) {
        this.wfsUrl = wfsUrl;
    }

    public String getSettingsUrl() {
        return settingsUrl;
    }

    public void setSettingsUrl(String settingsUrl) {
        this.settingsUrl = settingsUrl;
    }

    public Float getDefaultX() {
        return defaultX;
    }

    public void setDefaultX(Float defaultX) {
        this.defaultX = defaultX;
    }

    public Float getDefaultY() {
        return defaultY;
    }

    public void setDefaultY(Float defaultY) {
        this.defaultY = defaultY;
    }

    public Integer getDefaultScaleIndex() {
        return defaultScaleIndex;
    }

    public void setDefaultScaleIndex(Integer defaultScaleIndex) {
        this.defaultScaleIndex = defaultScaleIndex;
    }

    public Boolean getShowOnMainPage() {
        return showOnMainPage;
    }

    public void setShowOnMainPage(Boolean showOnMainPage) {
        this.showOnMainPage = showOnMainPage;
    }

    public String getDefaultLayersSet() {
        return defaultLayersSet;
    }

    public void setDefaultLayersSet(String defaultLayersSet) {
        this.defaultLayersSet = defaultLayersSet;
    }

    public Settings getSettings() {
        if (settings == null) {
            settings = new Settings(getSettingsUrl());
        }
        return settings;
    }

    public String getTransform() {
        return transform;
    }

    public void setTransform(String transform) {
        this.transform = transform;
    }

    @Override
    public String toString() {
        return getName();
    }

}
